<%-- 
    Document   : jakinUnico
    Created on : 11-nov-2011, 10:17:54
    Author     : igovan
--%>

<%@page import="logica.util.Perfil"%>
<%@page import="logica.util.ProfilesUtil"%>
<%@page import="modelo.DTO.PerfilAlumno"%>
<%@page import="modelo.DTO.PerfilesAlumnos"%>
<%@page import="modelo.DTO.DTOFactory"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page import="modelo.DTO.DTOPerfilAlumno"%>
<%@page import="logica.LogicaAlumno"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%!

private int valorColummnas;

%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="js/Sort.js"></script>
        <link rel="stylesheet" type="text/css" href="css/tabla.css" media="all">
        <link rel="stylesheet" type="text/css" href="css/styles.css" />
        <link rel="stylesheet" type="text/css" href="css/menu.css" />
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
        <script type="text/javascript" src="js/script.js"></script>
        <title>Resultados</title>
    </head>

    <body>
        <div class="headerLeyendaRegistros">
            <br>
            <h1></h1>
            <br>
            <div id="hmain">
                <p></p>
                <p></p>
            <h1>Resultados</h1>


            <table id="t1" class="example table-autosort table-autofilter table-autopage:10 table-stripeclass:alternate
                   table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount">
               <thead>
                <%
                //String nombre=request.getParameter("dato");
                String nombre = "angelosi";
                LogicaAlumno lAlumno=new LogicaAlumno();
                DTOFactory factoria=new DTOFactory();
                ProfilesUtil pUtil=ProfilesUtil.getInstance();
                PerfilAlumno alumno;
               // PerfilesAlumnos lista= factoria.fromDTOPerilAlumno2PerfilesAlumnos(lAlumno.getPerfilesAlumnos(pUtil));
                alumno=factoria.fromDTOPerilAlumno2PerfileAlumno(lAlumno.getPerfilAlumno(nombre, pUtil));
              //  Iterator iterador = lista.getLista().iterator();
                %><tr><th class="table-filterable table-sortable:default">Nombre</th><%
                Iterator iterPerf=ProfilesUtil.getInstance().getIterator();
                while(iterPerf.hasNext()){
                    Perfil perf=(Perfil)iterPerf.next();
                    %><th class="table-filterable table-sortable:default"><%=perf.getProfile(0)+"/"+perf.getProfile(perf.size()-1)%></th><%
                    valorColummnas=perf.size();
                }


                %></tr>
               </thead>
               <tbody>
               <%

               // while(iterador.hasNext()){
                  //  alumno=(PerfilAlumno)iterador.next();
                    try{
                        %><tr><td> <%=alumno.getNombre()%> </td>
                              <%
                              for(int i=0;i<=valorColummnas+4;i++){%>
                                  <td><strong><%=alumno.getPerfil().get(i)%></strong></td><%

                              }%>

                          </tr><%
                    }catch(Exception e){
                        %></strong><%
                    }
                    //falla que el get solo va hasta 2 y si hay mas perfiles tiene que ir dinamicamente hasta el numero de perfiles.
            //    }
                %>
                </tbody>
                <tfoot>
                        <tr>
                        <td class="table-page:previous" style="cursor:pointer;">&lt; &lt; Anterior</td>
                        <td colspan="3" style="text-align:center;">Página <span id="t1page"></span>&nbsp;de <span id="t1pages"></span></td>
                        <td class="table-page:next" style="cursor:pointer;">Siguiente &gt; &gt;</td>
                </tr>
                <tr>
                        <td colspan="5"><span id="t1filtercount"></span>&nbsp;alumnos encontrados en total</td>
                </tr>
                </tfoot>
           </table>
            </div>
        <div class="scroll"></div>

        <form action="controller.jsp" method="POST">
            <br>
            <input type="image" name="inicio" value="inicio" src="img/intro/volver.png" />
        </form>
        </div>

       <ul id="navigation">
            <li class="home"><a href="controller.jsp?inicio" name="inicio" title="Inicio"></a></li>
            <li class="pDefecto"><a href="controller.jsp?perfilesDefecto" name="perfilesDefecto" title="Perfiles defecto"></a></li>
            <li class="cPerfil"><a href="controller.jsp?crearPerfil" name="crearPerfil" title="Crear perfil"></a></li>
            <li class="leyendaRegistros"><a href="controller.jsp?leyendaRegistros" name="leyendaRegistros" title="Leyenda registros"></a></li>
            <li class="lanzarJakin"><a href="controller.jsp?lanzarJakin" name="lanzarJakin" title="Lanzar Jakin"></a></li>
        </ul>
        <script type="text/javascript">
            $(function() {
                $('#navigation a').stop().animate({'marginLeft':'-85px'},1000);

                $('#navigation > li').hover(
                    function () {
                        $('a',$(this)).stop().animate({'marginLeft':'-2px'},200);
                    },
                    function () {
                        $('a',$(this)).stop().animate({'marginLeft':'-85px'},200);
                    }
                );
            });
        </script>
        </body>
</html>






